﻿<%@ Page Title="" Language="C#" MasterPageFile="~/web/common/Common.Master" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="shop.web.view_admin.user.Register" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>注册</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="layui-container fly-marginTop">
        <div class="fly-panel fly-panel-user" pad20>
            <div class="layui-tab layui-tab-brief" lay-filter="user">
                <ul class="layui-tab-title">
                    <li><a href="login.aspx">登入</a></li>
                    <li class="layui-this">注册</li>
                </ul>
                <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
                    <div class="layui-tab-item layui-show">
                        <div class="layui-form layui-form-pane">
                            <form method="post" action="/handler/UserHandler.ashx">
                                <input type="hidden" name="method" value="register" />
                                <div class="layui-form-item">
                                    <label for="L_username" class="layui-form-label">用户名</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="L_username" name="userName" required lay-verify="required" autocomplete="off" class="layui-input">
                                    </div>
                                    <div class="layui-form-mid layui-word-aux">将会成为您唯一的登入名</div>
                                </div>
                                <div class="layui-form-item">
                                    <label for="L_email" class="layui-form-label">邮箱</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="L_email" name="email" required lay-verify="email" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label for="L_pass" class="layui-form-label">密码</label>
                                    <div class="layui-input-inline">
                                        <input type="password" id="L_pass" name="password" required lay-verify="required" autocomplete="off" class="layui-input">
                                    </div>
                                    <div class="layui-form-mid layui-word-aux">6到16个字符</div>
                                </div>
                                <div class="layui-form-item">
                                    <label for="L_repass" class="layui-form-label">确认密码</label>
                                    <div class="layui-input-inline">
                                        <input type="password" id="L_repass" name="rePassword" required lay-verify="required" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                               <%-- <div class="layui-form-item">
                                    <label for="L_vercode" class="layui-form-label">验证码</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="L_vercode" name="vercode" required lay-verify="required" placeholder="请回答后面的问题" autocomplete="off" class="layui-input">
                                    </div>
                                    <div class="layui-form-mid">
                                        <span style="color: #c00;">{{d.vercode}}</span>
                                    </div>
                                </div>--%>
                                <div class="layui-form-item">
                                    <button class="layui-btn register" lay-filter="*" type="button">立即注册</button>
                                </div>
                                
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
    <script>
        layui.cache.page = 'user';    
        var layer = layui.layer;
        $(".register").click(function () {
            $.ajax({
                url: $('form').attr('action'),
                type: "post",
                data: $("form").serialize(),
                success: function (data) {
                   var obj = JSON.parse(data); 
                    if (obj.ErrorCode === 0) {
                        //成功
                        layer.msg(obj.Message, { icon: 6,time: 2000 }, function () {
                            window.location.href="/index.aspx";
                        });  
                         
                    } else {
                        layer.alert(obj.Message,{icon: 5})
                    }      
                }
            })
        })
    </script>

</asp:Content>
